import React from 'react';
import style from './style.styl';
import { Avatar } from 'sq-ui';
import {buildText} from '../tool/util';

class OtherContent extends React.Component {
  constructor(props) {
    super(props);
    this.displayName = 'OtherContent';
  }
  render() {
    const {
      list
    } = this.props;
    if(!list.length) return null;
    return (
      <div className={style['other-area']}>
        <div className={style['peer-title']}>其他同事的反馈</div>
        {
          list.map((v, i) => {
            return (
              <div key={i}>
                <div className={style['other-box']}>
                  {
                    v.userProfile ? 
                    <div className={style['other-header']}>
                      <Avatar
                        style={{ margin: '0 10px 0 0' }}
                        width={30}
                        src={v.userProfile.avatarUrl}
                      />
                      <div className={style['avatar-name']}>
                        {v.userProfile.fullName}
                      </div>
                    </div>
                    : null
                  }
                  
                  <p>{buildText(v.content)}</p>
                </div>
              </div>
            );
          })
        }
      </div>
    );
  }
}

export default OtherContent;
